Allow the disasm output on xarch to do less work for the common path#117097
Merged
tannergooding merged 2 commits intodotnet:mainfrom Jul 1, 2025
Merged
Allow the disasm output on xarch to do less work for the common path#117097tannergooding merged 2 commits intodotnet:mainfrom
tannergooding merged 2 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
1eb7c48 to
f9b7a9b
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the disassembly output path for x86 instructions by precomputing pseudo-names for instructions, reducing unnecessary string copying in the common VEX path and simplifying the legacy hardware fallback.
- Introduces a new flag (INS_FLAGS_HasPseudoName) in the instruction flags.
- Updates display name generation in instr.cpp to remove redundant prefix operations.
- Refactors checks for pseudo-names in emitxarch.cpp and exposes the helper via codegeninterface.h.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/jit/instr.h | Added a new flag to mark instructions with a pseudo display name. |
| src/coreclr/jit/instr.cpp | Refactored display name functions with new lambdas and logic. |
| src/coreclr/jit/emitxarch.cpp | Simplified dispatch for instructions with pseudo names. |
| src/coreclr/jit/codegeninterface.h | Declared the new instHasPseudoName helper. |
Member
Author
|
CC. @dotnet/jit-contrib, small refactoring to make the instruction name fixups easier to understand and maintain. Reduces the amount of string copying for a typical jit disasm output by a decent amount as well. |
EgorBo
approved these changes
Jul 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most hardware we run on is currently VEX capable and we can spend a decent amount of time simply copying the instruction names into a temporary buffer just to add the
vprefix.This cleans that up by defaulting the instruction tables to have the
vprefixed name already and to instead simply return that + 1 in the case we're in a legacy hardware scenario.It also makes it easier to add instructions with pseudo names in the future.